const request = require('base')
const chat = require('./chat')


module.exports = {
	_before: function () {
		request.handleBefore(this)
	},
	
	_after(error, result) {
		return request.handleAfter(this, error, result)
	},
	
	// 基础对话
	dialogue(params) {
		const {data} = params
		params = params.params
		if (params && params.provider) {
			// 是大语言模型的参数
		} else {
			params = undefined
		}
		return chat(data, params)
	},
	
	// 生成图片
	generateImage(params) {
		const {data} = params
		params = params.params
		const baidu = require('./baidu')
		return baidu.generateImage(data, params)
	}
}
